﻿using System;
using CommonExtensions.ObjectExtensions;
using DBMigrator.Core.DbObjects.Data.Where;

namespace DBMigrator.Core.DbObjects.Data.Update.Set
{
    public class AdditionalSet : BaseSet, IAdditionalSet
    {
        public IWhere Where { get; private set; }

        public AdditionalSet(IAdditionalSet additionalSet, IWhere where) 
            : base(additionalSet)
        {
            if(where.IsNull())
                throw new ArgumentNullException("where");

            Where = where;
        }

        public IAdditionalSet AndColumnTo<T>(string columnName, T value)
        {
            return SetColumnTo(columnName, value);
        }
    }
}